/* Recursive Shell v1.0.1 17 June 1996 © 1996 Theron Trowbridge e-mail: theron@aimla.com -or- Tmonk@concentric.net snail-mail: 3685 Jasmine Ave. #19 Los Angeles, CA 90034 What Is This? this is a CodeWarrior 7 project which creates a shell application that makes it easy to create utility applications that perform some task to a large number of files. It supports drag-and-drop - simply drag files or folders to the icon and the application does to each what it wants. In the case of folders, it searches recursively through them and performs the same on each file/ folder inside. You can also start the whole process from the menus after launching the application, of course. It is easy to create new utility applications - you simply fill in the functionality of a few routines in one file, and it's done. The applications require System 7 or better. Who Is It For? I have, in the past, needed programs which can do what this shell does, but have been unable to find them. These are pretty specific tasks I needed them for, so it is unsurprising programs didn't already exist for them. But all of these things need a similar framework into which I would want to simply drop in small bits of functionality. That is where the idea for this shell started. This is really for anyone who also has need for a small utility which can do some fixed action on every file in a folder, or simply on a whole mess of files. If the task you need to do is simple, your new utility can be done in just a few minutes! The Legal Stuff This code is ©1996 Theron Trowbridge. It is offered without warranty to its correctness, functionality, or usefulness, and I cannot be held responsible for what you do with it, or any damage it may cause either through improper use or a mistake on my part. In other words, use at your own risk. You are free to use this code, but the portions of the code I wrote remain my copyright, so there are a few restrictions: You may not distribute the result of this code as a commercial product without my consent. Just ask - I'm likely to give it. With the exception on CD-ROM (or other commercial) collections, this code may be distributed freely, as long as it is in original form and all associated files (including this notice) are included in unmodified form. Permission is hereby granted for Celestin Company, Inc. (for the Apprentice CD-ROM), Pacific HiTech (for the Info-Mac CD-ROM) and the Arizona Macintosh User Group (For the BBS In A Box CD-ROM) to include this package in CD-ROM collections, provided a copy of the CD-ROM is provided to me for free or at a nominal cost. Other CD-ROM collections will almost certainly receive my permission for inclusion. Just contact me first, and give me a copy of the disc when published. How To Use It To create a new application, do the following: (Almost all of these are optional - only the first and last are essential) 1 - Make a copy of the project folder and rename it to whatever name you've chosen for your new application. 2 - Change the name of the two project files (Recursive Shell (68k).µ and Recursive Shell (PPC).µ) to reflect the name you've chosen. 3 - Change the PICT resource (ID 700) in the file Recursive Shell.rsrc to a splash screen for your application. 4 - Change text of About... item in the Apple Menu resource (ID 700) to reflect the name you've chosen for your application. 5 - Change the name of Recursive Shell.rsrc to reflect the new name. 6 - In each project, add your newly-named resource file and remove the old one. 7 - In each project's project preferences, change the output file name to the new name. 8 - Add your routines to DoStuff.c file: InitializeStuff(), DoToEachFile(), DoToEachFolder(), DoToSelFolder(), and DeInitializeStuff(). 9 - Make your new project. You can actually skip all of these steps, except for the last. You should make a copy of the project file, though. You can do as many or as few of these as you like. If you do skip these steps, the application name, about box, and About... menu item will be the default ones I've created. Oh, yeah - and it will recurse through folders and files, but it won't actually do anything to them. You can also change the icon (which is pretty ugly, I admit). Simply paste your new one into the Get Info... box in the finder. If you want to make it more permanent than that, you should pick a new Creator code (and register it with Apple - I already registered 'RCSH' which this one uses) to avoid icon conflicts. There are two sample applications which were created with this shell included in this package: ListFiles (which creates a text file containing the full pathname of each file processed) and Count Items (which counts the number of files and folders processed and tells the user). Known Problems Because of the way the items in a folder are read, if the program deletes any of the files, it will later trip up and run out of items. This will be fixed in the next version. DoToSelFile() in DoStuff.c is never called. It is there for balance with the DoToSelFolder() routine, but if you drop a file on the icon, it just calls DoToEachFile(). Should be removed. If you find any other bugs or unusual behavior, please let me know and I will fix it. Features For Future Versions More intelligent parsing of files (see Known Problems). A preferences file which keeps track of the following: Recurse into sub-directories? Resolve aliases? These will be options in future versions, and they will be automatically read from the preferences file. There will be a standard preferences interface to set them. Preferences API to allow the application to store its own preferences in the preferences file. A confirmation for aborting the process. A progress dialog box will be added, with possible pre-calcuation of numbers of files for an accurate progress bar. A nicer busy cursor (animated or something). Allow the user to select anything, not just a folder when selecting Open... item in the File Menu. Send me e-mail or snail mail and I will keep you on a list to receive free updates of the shell when they become available. Comments and suggestions also welcome. */